home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Compilers / Miracle C Compiler / miricleC compiler.msi / Instal01.cab / _258F09E52BF74839A255F32F1EBDE71D < prev    next >
Encoding:
Text File  |  1999-07-23  |  867 b   |  61 lines

  1. /* make the preprocessor jump through a few hoops */
  2.  
  3. #include <stdio.h>
  4.  
  5. #define plus(x,y) \
  6.         ((x)+(y))
  7.  
  8. #define ccat(x,y) x##y
  9. #define sify(x) #x
  10. #line 3 "prexy.c"
  11. #define karma 1
  12. #define woofma 7
  13. #pragma dogma
  14.  
  15. main()
  16. {
  17. int a=4,b=5,ab=6;
  18. puts("hello");
  19.  
  20. #ifdef woofma
  21. puts("yep");
  22. #else
  23. puts("nope");
  24. #endif
  25.  
  26. #ifdef karma
  27. puts("good karma 1");
  28. #else
  29. puts("bad else");
  30. #endif
  31.  
  32. #undef woofma
  33.  
  34. #if karma==2
  35. puts("bad karma a");
  36. #elif karma==1
  37. puts("good karma 2");
  38. #else
  39. puts("bad karma e");
  40. #endif
  41.  
  42. #ifdef woofma
  43. puts("nopey");
  44. #else
  45. puts("yeah");
  46. #endif
  47.  
  48. #ifndef woofma
  49. puts("yes");
  50. #else
  51. puts("noway");
  52. #endif
  53.  
  54. // this is a single line comment
  55.  
  56. printf("%d %d %s %d %s %s\n",
  57.     miracle,msdos,__FILE__,__LINE__,__DATE__,__TIME__);
  58.  
  59. printf("%d %d %d %s\n",plus(a,b),b,ccat(a,b),sify(a) "yeahok" sify(b));
  60. }
  61.